package com.blb.mapper;

import com.blb.entity.Shelves;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zyp
 * @since 2019-11-14
 */
public interface ShelvesMapper extends BaseMapper<Shelves> {
    /**
     * 查询全部
     * @return
     */
    public List<Shelves> getAll();
    /**
     * 查询全部货架info
     * 依据货架编号、创建时间
     * @param shelvesNo
     * @param
     * @return
     */
    public List<Shelves> getAllShelves(@Param("nodeId") String nodeId,@Param("nodeType") String nodeType,
                                       @Param("companyId") String companyId,@Param("shelvesNo") String shelvesNo,
                                       @Param("creatTime") String creatTime,@Param("start") int start, @Param("length") int length);

    /**
     * 计数
     * @param shelvesNo
     * @param creatTime
     * @return
     */
    int count(@Param("nodeId") String nodeId,@Param("nodeType") String nodeType,
              @Param("companyId") String companyId,
              @Param("shelvesNo") String shelvesNo,@Param("creatTime") String creatTime);
    /**
     * 依据goodId查询货架信息
     * @param damId
     * @return
     */
    @Select("SELECT * FROM t_shelves WHERE dam_id = #{damId}")
    List<Shelves> getByGoodId(String damId);

    void updateShelves(Shelves shelves);

    /**
     * 依据id查询全部shelves信息
     * @param id
     * @return
     */
    Shelves findShelvesById(String id);
    /*更新货架状态*/
    void updateShelvesStatus(@Param("id") String id,@Param("status") String status);
}
